package com.dingding.entity.request.user;

import com.dingding.common.validate.EditGroup;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserUpdateRequest {

    @ApiModelProperty(value = "用户ID")
    @NotNull(message = "参数ID不能为空", groups = {EditGroup.class})
    private Long id;

    @ApiModelProperty(value = "用户姓名")
    @Size(max = 32, message = "用户姓名不能大于32个字符")
    private String userName;

    @ApiModelProperty(value = "手机号码")
    @NotBlank(message = "手机号码不能为空")
    @Size(min = 11, max = 11, message = "手机号码只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号码格式有误")
    private String phoneNumber;

    @ApiModelProperty(value = "工号")
    @Size(max = 100, message = "工号不能大于100个字符")
    private String workerNo;

    @ApiModelProperty(value = "企业名称")
    @Size(max = 100, message = "企业名称不能大于100个字符")
    private String enterpriseName;

    @ApiModelProperty(value = "企业邮箱")
    @Email(message = "企业邮箱格式有误")
    @Size(max = 100, message = "企业邮箱不能大于100个字符")
    private String enterpriseEmail;

    @ApiModelProperty(value = "头像图片文件")
    private MultipartFile userIconUrl;

}
